package com.my.chapter12;

public class practice11 {
    static void g() throws OneException{
        System.out.println("Originating the exception in g()");
        OneException o = new OneException("thrown from g()");
        throw new RuntimeException(o);
    }
    static void f() throws TwoException{
        try {
            g();
        }catch (OneException e){
            e.printStackTrace(System.out);
            throw new TwoException("thrown from f()");
        }
    }

    public static void main(String[] args) {
        try {
            f();
        }catch (TwoException e){
            System.out.println("TwoException");
            e.printStackTrace();
        }
    }
}
